rsAdminLogin.Open "select * from Admin_Login_master where company_Id=" & Global_CompanyId & " ", con, adOpenKeyset, adLockOptimistic
If rsAdminLogin.RecordCount = 0 Then
Exit Sub
End If
If classED.DecodeString(rsAdminLogin.Fields(0).Value) = Trim(txtName.Text) And classED.DecodeString(rsAdminLogin.Fields(1).Value) = Trim(txtPassword.Text) Then
Call proLogerNameAdmin 'For Displaying Login Name
'MsgBox ("Password Succeed")
Unload Me
Call c1.proAdminLogin
loginflag = 1
Exit Sub
Else
If counter >= 3 Then
End 'After three attempt software will be terminated
End If
counter = counter + 1 ' for maximum trying of unknown login
MsgBox "ACCESS DENIED DUE TO SECURITY", vbOKOnly, "WORNG PASSWORD"
txtName.Text = ""
txtPassword.Text = ""
txtName.SetFocus
Exit Sub
End If
ElseIf ChangeFlag = 1 Then
If classED.DecodeString(rsAdminLogin.Fields(0).Value) = Trim(txtName.Text) And classED.DecodeString(rsAdminLogin.Fields(1).Value) = txtPassword.Text Then
Label1.Caption = "Enter New Admin Name"
Label2.Caption = "Enter New Password"
Label3.Visible = True
txtReTypePassword.Visible = True
txtName.Text = ""
txtPassword.Text = ""
txtName.SetFocus
ChangeFlag = 2
Else
MsgBox "Access Denied Due to Security", vbInformation + vbOKOnly, "Friendly Advise"
End If
ElseIf ChangeFlag = 2 Then
If txtPassword.Text = "" Then
MsgBox "You Must Not Let Password To Be Blank", vbInformation + vbOKOnly, "Friendly Advice"
txtPassword.SetFocus
Exit Sub
ElseIf txtName.Text = "" Then
MsgBox "You Must Not Let User Name To Be Blank", vbInformation + vbOKOnly, "friendly Advice"